package cn.kpi.service.usualassessment.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.kpi.dao.usualassessment.UserTempDao;
import cn.kpi.entity.usualassessment.UsAssTemplateEntity;
import cn.kpi.entity.usualassessment.UserUsAssTempEntity;
import cn.kpi.service.usualassessment.IUserTempService;

@Service
public class UserTempServiceImpl implements IUserTempService {

	@Autowired
	private UserTempDao userTempDao;

	public List<UsAssTemplateEntity> GetUsAssTemplateListByWhere(String where, int beginrow, int endrow)
			throws Exception {
		try {
			return userTempDao.GetUsAssTemplateListByWhere(where, beginrow, endrow);
		} catch (Exception ex) {
			ex.printStackTrace();
			return null;
		}
	}

	public int GetUsAssTemplateListCountByWhere(String where) throws Exception {
		try {
			return userTempDao.GetUsAssTemplateListCountByWhere(where);
		} catch (Exception ex) {
			ex.printStackTrace();
			return -1;
		}
	}
	
	public List<UserUsAssTempEntity> GetUserUsAssTempListByWhere(String where,int beginrow,int endrow)throws Exception{
		try {
			return userTempDao.GetUserUsAssTempListByWhere(where, beginrow, endrow);
		} catch (Exception ex) {
			ex.printStackTrace();
			return null;
		}
	}
	
	public int GetUserUsAssTempListCountByWhere(String where)throws Exception{
		try {
			return userTempDao.GetUserUsAssTempListCountByWhere(where);
		} catch (Exception ex) {
			ex.printStackTrace();
			return -1;
		}
	}
	
	public int InsertTemplateEntity(UsAssTemplateEntity entity)throws Exception{
		try {
			return userTempDao.InsertTemplateEntity(entity);
		} catch (Exception ex) {
			ex.printStackTrace();
			return -1;
		}
	}
	public List<UserUsAssTempEntity> GetUserGroupListByWhere(String where)throws Exception{
		try {
			return userTempDao.GetUserGroupListByWhere(where);
		} catch (Exception ex) {
			ex.printStackTrace();
			return null;
		}
	}

}
